import 'package:flutter_dva/flutter_dva.dart';
import 'package:todo_app/controllers/definitions/UserModel.dart';
import 'package:todo_app/models/system.dart';

extension DvaActions on Props {
  Future login(UserModel payload) { return dispatch(SystemModel.login, payload: payload, namespace: 'system'); }
  Future register(UserModel payload) { return dispatch(SystemModel.register, payload: payload, namespace: 'system'); }
  Future logout() { return dispatch(SystemModel.logout, namespace: 'system'); }
  Future getUserInfo() { return dispatch(SystemModel.getUserInfo, namespace: 'system'); }
}